package subumbo.leg.view {
	import org.robotlegs.mvcs.Mediator;
	
	import subumbo.leg.controller.signal.ResizeSignal;
	import subumbo.leg.controller.signal.StateChangeSignal;
	
	/**
	 * Abstract Mediator for view components that implement IViewComponent. It can also be used as a concrete class.
	 * @author pwolleb
	 */	
	public class ViewComponentMediator extends Mediator {
		
		[Inject] public var resizeSignal:ResizeSignal;
		[Injetc] public var stateChangeSignal:StateChangeSignal;
				
		protected var _view:IViewComponent;
		
		override public function onRegister():void {
			resizeSignal.add(_view.resize);
			_view.stateChangeSignal = stateChangeSignal;
		}
		
		override public function onRemove():void {
			resizeSignal.remove(_view.resize);
		}
	}
}